#!/usr/bin/python
#

"""Schema used for the weight log app."""

__author__ = 'scottakirkwood@gmail.com (Scott Kirkwood)'

from google.appengine.ext import db

class Meeting(db.Model):
    """The data schema for Meeting.
    We separate out the list of e-mail from the list of attendees.
    """
    user = db.UserProperty(required=True, indexed=True)
    timestamp = db.DateTimeProperty(auto_now_add=True)
    topic = db.StringProperty()
    attendees = db.StringListProperty()
    emails = db.StringListProperty()
    fname = db.StringProperty()
    mm_source = db.TextProperty()
  

class Minutes(db.Model):
    """The data schema for the minutes, organized by time and person."""
    meeting = db.ReferenceProperty(Meeting, required=True)
    timestamp = db.DateTimeProperty()
    person = db.StringProperty()
    text = db.TextProperty()


class UserToMeeting(db.Model):
    """Explicitly keep track of emails to meetings.
    This can be reconstructed from Meetings if needed.
    This is a explicit denormalization for speed, 
    the Meeting class is considered the owner of the data.
    """
    email = db.StringProperty(required=True, indexed=True)
    timestamp = db.DateTimeProperty(auto_now_add=True)
    meeting = db.ReferenceProperty(Meeting, required=True)
    topic = db.StringProperty()
    attendees = db.StringListProperty()


  

